package com.example.librarymanagement.service.impl;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.librarymanagement.dao.PeriodicalsMapper;
import com.example.librarymanagement.dto.periodical.PeriodicalListDto;
import com.example.librarymanagement.entity.Periodical;
import com.example.librarymanagement.service.IPeriodicalService;
import com.example.librarymanagement.vo.PeriodicalVo;
import org.springframework.stereotype.Service;

/**
 * @author zjia
 */
@Service
public class IPeriodicalServiceImpl extends ServiceImpl<PeriodicalsMapper, Periodical> implements IPeriodicalService {
    @Override
    public IPage<PeriodicalVo> getPeriodicalsList(PeriodicalListDto periodicalListDto) {

        Page<PeriodicalVo> page = new Page<>(periodicalListDto.getCurrent(), periodicalListDto.getSize());
        return baseMapper.getPeriodicalsList(page, periodicalListDto);
    }
}
